import React,{Component} from 'react'
import { render } from 'react-dom'
import routes from './routes'
import stores from './stores'
import { HashRouter } from 'react-router-dom'
import {Provider} from 'mobx-react'
import {LocaleProvider} from 'antd';
import zhCN from 'antd/lib/locale-provider/zh_CN';
import Parse from 'parse';
import './mock'

Parse.initialize('Q46DARHpsxUfbFY7')
Parse.serverURL = 'http://localhost:4040/parse'

function App(){
  return (
    <HashRouter>
      <LocaleProvider locale={zhCN}>
        <Provider {...stores}>
          {routes}
        </Provider>
      </LocaleProvider>
    </HashRouter>
  )
}

const container = document.getElementById('container');
render(
  <App />,
  container
)

if(module.hot){
  module.hot.accept('./routes', () => {
    render(
      <App />,
      container
    )
  });
}
